package com.ms.service.module.analysisgroup.db.model;

import java.math.BigDecimal;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import com.ms.service.module.analysisgroup.CoinExpenditureWay;
import com.xpec.c4.db.model.basic.BasicModel;

/**
 * 每日C幣產出紀錄(半小時更新一次)
 */
@Entity
@org.hibernate.annotations.Entity(dynamicInsert = true, dynamicUpdate = true)
@Table(name = CoinExpenditureLogModel.tableName)
@org.hibernate.annotations.Table(
	appliesTo = CoinExpenditureLogModel.tableName,
	indexes = {
		@org.hibernate.annotations.Index(name = "IDX_RECORD_TIME", columnNames = { "recordTime" }),
	}
)
public class CoinExpenditureLogModel extends BasicModel {
	/**
	 * 
	 */
	private static final long serialVersionUID = 9219508426263015329L;

	public static final String tableName = "coin_expenditure_log";

	private int dbID;
	
	/**
	 * 紀錄時間
	 */
	private Date recordTime;
	
	/**
	 * 支出方式
	 */
	private CoinExpenditureWay coinExpenditureWay;
	
	/**
	 * 支出方式(中文)
	 */
	private String coinExpenditureWayDesc;
	
	/**
	 * 支出量
	 */
	private BigDecimal expenditure;

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	public int getDbID() {
		return dbID;
	}

	public void setDbID(int dbID) {
		this.dbID = dbID;
	}

	public Date getRecordTime() {
		return recordTime;
	}

	public void setRecordTime(Date recordTime) {
		this.recordTime = recordTime;
	}

	@Enumerated(EnumType.STRING)
	public CoinExpenditureWay getCoinExpenditureWay() {
		return coinExpenditureWay;
	}

	public void setCoinExpenditureWay(CoinExpenditureWay coinExpenditureWay) {
		this.coinExpenditureWay = coinExpenditureWay;
	}

	public String getCoinExpenditureWayDesc() {
		return coinExpenditureWayDesc;
	}

	public void setCoinExpenditureWayDesc(String coinExpenditureWayDesc) {
		this.coinExpenditureWayDesc = coinExpenditureWayDesc;
	}

	@Column(precision = 19, scale = 2, columnDefinition = "DECIMAL(19,2) default 0.0")
	public BigDecimal getExpenditure() {
		return expenditure;
	}

	public void setExpenditure(BigDecimal expenditure) {
		this.expenditure = expenditure;
	}

}
